package com.ruoyi.business.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 基础业务对象 sd_business
 * 
 * @author xx
 * @date 2020-03-16
 */
public class Business extends BaseEntity{

    /** 主键id */
    private Long id;

    /** 批量删除参数 字符串 */
    private String ids;

    /** 对应上面的id */
    private List<Long> idList;

    /** 业务类型 来源字典表 */
    @Excel(name = "业务类型", readConverterDict = "sd_business_type")
    @NotNull(message = "业务类型不能为空")
    private Integer businessType;

    /** 充值通道 来源字典表 业务类型为话费充值的时候 */
    @Excel(name = "充值通道", readConverterDict = "sd_recharge_channel")
    private Integer rechargeChannel;

    /** 业务编号 */
    @Excel(name = "业务编号")
    @NotBlank(message = "业务编号不能为空")
    @Size(min = 6, message = "业务编号长度必须大于{min}")
    private String businessCode;

    /** 合作公司 */
    @Excel(name = "合作公司")
    private String company;

    /** 联系人 */
    @Excel(name = "联系人")
    private String contactPerson;

    /** 联系方式 */
    @Excel(name = "联系方式")
    private String mobile;

    /** 业务价格 */
    @Excel(name = "业务价格")
    private String price;

    /** 状态 0-正常 1-停用 */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private Integer status;

//    @Excel(name = "所属用户id")
    private Long userId;

    @Excel(name = "所属用户")
    @NotBlank(message = "所属用户不能为空")
    private String userName;

    /** 当前用户id和直属下级用户id集合 */
    private List<Long> userIds;

    /** 面额和实际价格 */
    @Valid
    private List<BusinessMoney> prices;

    public List<Long> getIdList() {
        return idList;
    }

    public void setIdList(List<Long> idList) {
        this.idList = idList;
    }

    public String getIds() {
        return ids;
    }

    public void setIds(String ids) {
        this.ids = ids;
    }

    public List<BusinessMoney> getPrices() {
        return prices;
    }

    public void setPrices(List<BusinessMoney> prices) {
        this.prices = prices;
    }

    public List<Long> getUserIds() {
        return userIds;
    }

    public void setUserIds(List<Long> userIds) {
        this.userIds = userIds;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public void setId(Long id){
        this.id = id;
    }

    public Long getId(){
        return id;
    }
    public void setBusinessType(Integer businessType){
        this.businessType = businessType;
    }

    public Integer getBusinessType(){
        return businessType;
    }
    public void setRechargeChannel(Integer rechargeChannel){
        this.rechargeChannel = rechargeChannel;
    }

    public Integer getRechargeChannel(){
        return rechargeChannel;
    }
    public void setBusinessCode(String businessCode){
        this.businessCode = businessCode;
    }

    public String getBusinessCode(){
        return businessCode;
    }
    public void setCompany(String company){
        this.company = company;
    }

    public String getCompany(){
        return company;
    }
    public void setContactPerson(String contactPerson){
        this.contactPerson = contactPerson;
    }

    public String getContactPerson(){
        return contactPerson;
    }
    public void setMobile(String mobile){
        this.mobile = mobile;
    }

    public String getMobile(){
        return mobile;
    }
    public void setPrice(String price){
        this.price = price;
    }

    public String getPrice(){
        return price;
    }
    public void setStatus(Integer status){
        this.status = status;
    }

    public Integer getStatus(){
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("businessType", getBusinessType())
            .append("rechargeChannel", getRechargeChannel())
            .append("businessCode", getBusinessCode())
            .append("company", getCompany())
            .append("contactPerson", getContactPerson())
            .append("mobile", getMobile())
            .append("price", getPrice())
            .append("remark", getRemark())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
